import 'package:flutter/material.dart';

//Flutter 富文本
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    //脚手架
    return Scaffold(
      appBar: AppBar(
        //最左侧的按钮
        leading: IconButton(onPressed: () {}, icon: Icon(Icons.clear)),
        //中间的标题
        title: Text('这里是中间'),
        //标题剧中
        centerTitle: true,

        //最右侧的 widget
        actions: [
          IconButton(onPressed: () {}, icon: Icon(Icons.help)),
          IconButton(onPressed: () {}, icon: Icon(Icons.search)),
          IconButton(onPressed: () {}, icon: Icon(Icons.settings)),
        ],

        //背景色
        backgroundColor: Colors.blue,
        //前景色
        foregroundColor: Colors.white,

        //阴影高度
        elevation: 10,
        //阴影颜色
        shadowColor: Colors.black,
        //表面色调颜色
        surfaceTintColor: Colors.transparent,
        //开着
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.vertical(bottom: Radius.circular(20)),
        ),
      ),
      body: Center(
        child: SizedBox.expand(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Container(width: 200, height: 200, color: Colors.grey[300]),
            ],
          ),
        ),
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
